<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <!-- 可以接受第二个参数是index索引 -->
      <!-- for in 可以变成 for of -->
      <p v-for="(item, index) of items">{{ item.message }} - {{ index }}</p>

      <!-- v-for还可以遍历对象 -->
      <!-- 遍历对象的时候有三个参数，分别是velue，key，index -->
      <ul>
        <li v-for="(item, key, index) in object">
          {{ item }} - {{ key }} - {{ index }}
        </li>
      </ul>
    </div>

    <script src="../Vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          items: [{ message: "Foo" }, { message: "Bar" }],
          object: {
            title: "How to do lists in Vue",
            author: "Jane Doe",
            publishedAt: "2016-04-10",
          },
        },
      });
    </script>
  </body>
</html>
